package com.qsxc.system.exception;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * 微信提现系统错误，这种情况交易订单号必须保持，再次交易时必须用相同的订单号。否则可能出现多扣款的情况。
 */
@Data
@Slf4j
public class WxSystemException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = 0;

    public WxSystemException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public WxSystemException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    @Override
    public void printStackTrace() {
        if (getMessage() != null) {
            log.info(getMessage());
        }
    }
}
